package com.eposi.eposigameinterface.adapter;

import com.eposi.eposigameinterface.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.TextView;

public class LevelMoneyAdapter extends BaseAdapter {
	Context ctx;
	LayoutInflater mInflater;
	public LevelMoneyAdapter(Context ctx) {
		this.ctx = ctx;
		mInflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}
	@Override
	public int getCount() {
		return 80;
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		LevelMoneyHolder holder;
		if (arg1 == null) {
			holder = new LevelMoneyHolder();
			arg1 = mInflater.inflate(R.layout.level_money_item, null);
			holder.checkbox = (CheckBox) arg1.findViewById(R.id.level_play_check_box);
			holder.textView = (TextView) arg1.findViewById(R.id.level_play_text_view);
			arg1.setTag(holder);
			arg1.setTag(R.id.level_play_check_box, holder.checkbox);
		}else{
			holder = (LevelMoneyHolder) arg1.getTag();
		}
		int number = 1+ arg0;
		holder.checkbox.setTag(arg0);
//		holder.checkbox.setText(number+"00");
		holder.textView.setText(number + "00");
		return arg1;
	}
	class LevelMoneyHolder{
		CheckBox checkbox;
		TextView textView;
	}

}
